home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
7_10.lha
/
7_10
/
7_10process.h
< prev
next >
Wrap
Text File
|
1993-08-08
|
2KB
|
62 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ all discrete events are derived from class process
lass process : public process_object
// private: ...
include "7_10pr1.h" /* DELETE */
include "7_10pr2.h" /* DELETE */
include "7_10pr3.h" /* DELETE */
ublic:
friend process_object;
char *t_name; // the name of this process
process(char *name = 0);
~process();
// process manipulation
void exec(); // run the process
virtual long main(); // the actual process
int pending(); // 1 until process completed
void exit(long); // end process with value
long result(); // get exit value of process
void kill(long = 0); // stop process
// allow user to set t_exit_fct
PVFV atexit(PVFV);
// Stop this process until one of the
// objects becomes available
int wait(process_object **);
int wait(process_object*, process_object* = 0,
process_object* = 0, process_object* = 0,
process_object* = 0, process_object* = 0);
// Stop until rescheduled, then
// alert a process_object.
void pause(process_object* = 0);
// Stop until time comes along
void sleep(unsigned long);
// pseudo-time manipulation
unsigned long time() // Get current time
{ return t_curtime; }
void stime(unsigned long); // Set current time
// priority manipulation
int getpriority() // Get current priority
{ return t_priority; }
int setpriority(int); // Set current priority
// a pseudo-process for main()
friend process *const main_process();
// provide safe access to t_thisprocess
friend process *const this_process();
ostream &print(ostream&); // DELETE
void dumpall(ostream&); // DELETE
;